package com.lovo.controller;


import com.lovo.result.ResponseResult;
import com.lovo.service.ICommomentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bdk
 * @since 2021-03-11
 */
@RestController
@RequestMapping("/commoments")
@ResponseResult
public class CommomentController {
    @Resource
    private ICommomentService commomentService;
    @GetMapping
    public Object showAll(Long userId){
        return commomentService.selectAllCommoment(userId);
    }
    @GetMapping("/doLike")
    public Object doLike(Long commomentId,Long userId){
        commomentService.doLikeCommoment(commomentId,userId);
        return null;
    }
    @GetMapping("/cancelLike")
    public Object cancelLike(Long commomentId,Long userId){
        commomentService.cancelLikeCommoment(commomentId,userId);
        return null;
    }

}

